#$language = "VBScript"
#$interface = "1.0"
crt.Screen.Synchronous = True
Dim txtFilePath
txtFilePath = crt.Arguments(0)  ' 获取文本文件路径
Set fso = CreateObject("Scripting.FileSystemObject")   ' 创建文件系统对象
Set file = fso.OpenTextFile(txtFilePath, 1) ' 1 表示只读模式
firstLine = file.ReadLine    ' 读取第一行
GetFirstLine = firstLine    ' 获取第一行内容

sub main
    call sys_name
    call get_tow_line
end sub

Sub sys_name
	crt.Screen.Send "sys" & chr(13)
	crt.Screen.Send "sy "& GetFirstLine & chr(13)
	crt.Screen.WaitForString GetFirstLine
	crt.Screen.Send "un in en" & chr(13)
    crt.Screen.WaitForString GetFirstLine
End Sub

sub get_tow_line

    ' 逐行读取文件内容并发送到终端
    Do Until file.AtEndOfStream
        nextline = file.ReadLine
        crt.Screen.Send nextline & vbCrLf ' 发送当前行到终端，并在末尾添加回车换行符
        ' 等待特定的字符串出现
        crt.Screen.WaitForString GetFirstLine
    Loop
    ' 关闭文件
    file.Close
    Set file = Nothing
    Set fso = Nothing

end sub


